Improve screen reader experience on site meta lists #239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #235
The flex layout on the site meta list items causes the nested elements to be read individually, rather than as a complete
label: value
pair.This PR adds an
aria-label
attribute on the list items which is read as intended, eg. 'Category: Creative'. Nested elements havearia-hidden
unless they contain a URL, as this still needs to be accessible. This reduces duplicated content unless necessary.On the home page the labels are visibly hidden, so there are changes to not render them at all in this case, and rely on the
aria-label
instead.There is no visual change.
The resulting HTML looks like this:
Home
Single
Testing
Use a screen reader to navigate the home and single site pages, checking how the screen reader interprets the meta list.
It should announce the list, then read each list item as
label: value
, and you should be able to navigate to the link within if appropriate (only country and published don't have links).The label text should not be read twice.